<script src="https://cdn.jsdelivr.net/npm/axios@0.27.2/dist/axios.min.js"></script>

<script>
    // async function fn(){
    //     const result = await axios.get('http://ajax-api.itheima.net/api/category/top')
    //     console.log(result)
    // }

    // fn()
    const p = new Promise((resolve, reject) => {
        setTimeout(() => {
            resolve(100)
        }, 200)
    })

    // async function f1(){
    //     const r = await p
    //     console.log(r)
    // }
    // f1()

    ;( async function(){
        const r = await p
        console.log(r)
    })()


    // function fn(){
    //     axios.get('http://ajax-api.itheima.net/api/category/top').then(result=>{
    //         console.log(result)
    //     })
    // }

    // fn()


</script>